

unsafty_pwd = ['woaini1314', 'qq123456', '00000000', '1qaz2wsx', '1q2w3e4r', '123456aa', 'woaini520', 'woaini123', '123456789', '123456789a', 'a123456789',
    'asd123456', 'a5201314', 'aa123456', 'zhang123', 'aptx4869', '1q2w3e4r5t', '1qazxsw2', '5201314a', 'aini1314', '31415926', 'q1w2e3r4', '123456qq',
    'woaini521', '1234qwer', 'iloveyou', '123456abc', '123qweasd', 'qwer1234', 'qq123123', 'abc123456', 'qq5201314', '12345678', 'as123456', 'qazwsx123',
    'zxc123456', 'abcd1234', 'love1314', '11111111', '12qwaszx', '5845201314', 'nihao123', 'caonima123', 'zxcvbnm123', '1A2B3C4D', 'asdasd123', '1123581321',
    'qq1314520', 'password', 'p@ssword', 'trustno1', 'baseball', 'sunshine', 'passw0rd', 'superman', 'football'];
function toUpperCase(obj) {
    obj.value = obj.value.toUpperCase();
    if (document.getElementById("idcode").value.toString().length == 6) {
        document.getElementById("checkCodeBtn").disabled = false;
    } else {
        document.getElementById("checkCodeBtn").disabled = true;
    }
}

//忘记密码的js（弹窗popup）
$(document).ready(function () {
    $("#next").click(function () {
        var finduser = $("#idfinduser").val();
        $.get("/GZGL/findpassword/verifyUsername/", { 'finduser': finduser }, function (ret) {
            if (ret == finduser) {
                $('#closeclose').click();
                $('#error_info').css('display', 'none');
                $('#nextnext').click();
                $('#user_id_id').attr("value", ret);
            }
            if (!(ret == finduser)) {
                $('#error_info').html(ret);
                $('#error_info').css('display', 'inline');
            }
        })
    });
    $("#checkEmailBtn").click(function () {
        var email = $("#idemail").val();
        var id = $("#user_id_id").val();
        var which = $("#typereset").val();
        $.get("/GZGL/findpassword/verifyEmail/", { 'email': email, 'id': id }, function (ret) {
            if (ret == email) {

                $('#error_info_Email').css('display', 'none');
                $('#emailemail').attr("value", ret);
                if (which == "popup") {
                    $('#closecloseclose').click();
                    $('#next3').click();
                }
                if (which == "page") {
                    $('#warning_info_SendEmail').css('display', 'inline');
                    $('#wayemail').css('display', 'none');
                    $('#EmailCodeInput').css('display', 'inline');
                    $('#checkEmailBtn').css('display', 'none');
                    $('#checkCodeBtn').css('display', 'inline');
                }

                $.get("/GZGL/findpassword/sendemail/", { 'id': id }, function (ret) {
                    if (ret == "SuccessSend") {
                        $('#right_info_SendEmail').html("您的邮件已发送成功，请查收！");
                        $('#warning_info_SendEmail').css('display', 'none');
                        $('#right_info_SendEmail').css('display', 'inline');
                    }
                    if (ret == "FailSend") {
                        $('#error_info_SendEmail').html("您的邮件发送失败，请重试！");
                        $('#error_info_SendEmail').css('display', 'inline');
                    }
                })
            }
            if (!(ret == email)) {
                $('#error_info_Email').html(ret);
                $('#error_info_Email').css('display', 'inline');
            }
        })
    });
    $("#checkCodeBtn").click(function () {
        var code = $("#idcode").val();
        var id = $("#user_id_id").val();
        var which = $("#typereset").val();
        $.get("/GZGL/findpassword/verifyCode/", { 'code': code, 'id': id }, function (ret) {
            if (ret == "RightCode") {
                $('#error_info_SendEmail').css('display', 'none');
                if (which == "popup") {
                    $('#closeclosecloseclose').click();
                    $('#next5').click();
                }
                if (which == "page") {
                    $('#second2').attr('disabled', "true");
                    $('#third3').removeAttr("disabled");
                    $('#third3').removeClass("btn-outline");
                    $('#EmailCodeInput').css('display', 'none');
                    $('#checkCodeBtn').css('display', 'none');
                    $('#newPWDInput').css('display', 'inline');
                    $('#setNewPWDBtn').css('display', 'inline');
                    $('#radio_sendemail').attr('disabled', "true");
                    $('#radio_pwd').attr('disabled', "true");
                }

            }
            if (!(ret == "RightCode")) {
                $('#error_info_SendEmail').html(ret);
                $('#error_info_SendEmail').css('display', 'inline');
            }
        })
    });
    $("#67963zc").click(function () {
        var pwd = $("#inputConfirmpassword").val();
        var id = $("#user_id_id").val();
        $.get("/GZGL/findpassword/verifySetPWD/", { 'pwd': pwd, 'id': id }, function (ret) {
            if (ret == "SuccessSave") {

                $('#sectiontion').css('display', 'none');
                $('#sectiontion2').css('display', 'inline');
            }
            if (!(ret == "SuccessSave")) {
                $('#error_info5').html(ret);
                $('#error_info5').css('display', 'inline');
            }
        })
    });
    $("#relogin").click(function () {
        $("#closecloseclosecloseclose").click();
        $(location).attr('href', '/GZGL/mylogin/');
    });
});

//重置密码的js（弹窗popup）
$(document).ready(function () {
    $("#forgotoldpwd").click(function () {
        $('#closeresetpwd').click();
    });

    $('input:radio[name="checkMethod"]').click(function () {
        var key = $('input:radio[name="checkMethod"]:checked').val();
        if (key == "sendemail") {
            $('#first1').attr('disabled', "true");
            $('#second2').removeAttr("disabled");
            $('#second2').removeClass("btn-outline");
            $('#wayPWD').css('display', 'none');
            $('#wayShowContext').css('display', 'none');
            $('#wayemail').css('display', 'inline');
            $('#checkEmailBtn').css('display', 'inline');
            $('#checkOldPWDBtn').css('display', 'none');

        }
        if (key == "pwd") {
            $('#first1').attr('disabled', "true");
            $('#second2').removeAttr("disabled");
            $('#second2').removeClass("btn-outline");
            $('#wayemail').css('display', 'none');
            $('#wayShowContext').css('display', 'none');
            $('#wayPWD').css('display', 'inline');
            $('#checkEmailBtn').css('display', 'none');
            $('#checkOldPWDBtn').css('display', 'inline');

        }
        else {
            $('#warning_info_SendEmail').css('display', 'none');
        }
    });


    $("#checkOldPWDBtn").click(function () {
        var iddd = $("#user_id_id2").val();
        var pwd1 = $("#oldpwd").val();
        var which = $("#typereset").val();
        $.get("/GZGL/ResetPwd/CheckeOldPWD/", { 'pwd': pwd1, 'idd': iddd }, function (ret) {
            if (ret == "RightCode") {
                if (which == "popup") {
                    $('#oldpwd').css('disabled', 'true');
                    $('#newPWDInput').css('display', 'inline');
                    $('#checkOldPWDBtn').css('display', 'none');
                    $('#resetbutton').css('display', 'inline');
                    $('#setNewPWDBtn').css('disabled', 'true');
                    $('#error_info_oldPWD').css('display', 'none');
                }
                if (which == "page") {
                    $('#second2').attr('disabled', "true");
                    $('#third3').removeAttr("disabled");
                    $('#third3').removeClass("btn-outline");
                    $('#wayPWD').css('display', 'none');
                    $('#checkOldPWDBtn').css('display', 'none');
                    $('#newPWDInput').css('display', 'inline');
                    $('#setNewPWDBtn').css('display', 'inline');
                    $('#error_info_oldPWD').css('display', 'none');
                    $('#radio_sendemail').attr('disabled', "true");
                    $('#radio_pwd').attr('disabled', "true");
                }


            }
            if (!(ret == "RightCode")) {
                $('#error_info_oldPWD').html(ret);
                $('#error_info_oldPWD').css('display', 'inline');
            }
        })
    });
    $("#setNewPWDBtn").click(function () {
        var pwd = $("#inputConfirmpassword2").val();
        var id = $("#user_id_id2").val();
        var which = $("#typereset").val();
        $.get("/GZGL/findpassword/verifySetPWD/", { 'pwd': pwd, 'id': id }, function (ret) {
            if (ret == "SuccessSave") {
                if (which == "popup") {
                    $('#closeresetpwd').click();
                    $('#next5').click();
                    $('#sectiontion').css('display', 'none');
                    $('#sectiontion2').css('display', 'inline');
                }
                if (which == "page") {
                    $('#third3').attr('disabled', "true");
                    $('#fourth4').removeAttr("disabled");
                    $('#fourth4').removeClass("btn-outline");
                    $('#newPWDInput').css('display', 'none');
                    $('#setNewPWDBtn').css('display', 'none');
                    $('#setPWDSuccess').css('display', 'inline');
                }

            }
            if (!(ret == "SuccessSave")) {
                $('#error_info5').html(ret);
                $('#error_info5').css('display', 'inline');
            }
        })
    });
});

function checkpassword() {
    var inputPassword = document.getElementById('inputPassword').value;
    var inputConfirmpassword = document.getElementById('inputConfirmpassword').value;
    if (inputConfirmpassword != inputPassword) {
        document.getElementById("inputError3").style.display = "inline";
        document.getElementById("67963zc").disabled = true;
    }
    if (inputConfirmpassword == inputPassword) {
        document.getElementById("inputError3").style.display = "none";
        document.getElementById("67963zc").disabled = false;
    }
}
function checkpassword2() {
    var inputPassword = document.getElementById('inputPassword2').value;
    var inputConfirmpassword = document.getElementById('inputConfirmpassword2').value;
    if (inputConfirmpassword != inputPassword) {
        document.getElementById("inputErrorPWDUnSame").style.display = "inline";
        document.getElementById("setNewPWDBtn").disabled = true;
    }
    if (inputConfirmpassword == inputPassword) {
        document.getElementById("inputErrorPWDUnSame").style.display = "none";
        document.getElementById("setNewPWDBtn").disabled = false;
    }
}




